#ifndef REFERENCE
#define REFERENCE

#include "../math/serialise.h"
#include "../math/array.h"
#include "../math/aabbox.h"
#include "../os/string.h"

namespace sleek
{
    namespace core
    {
        namespace engine
        {
            struct attribute
            {
                attribute(){ name = "undefined"; }
                attribute(os::stringc _name, os::stringc _value) : name(_name), value(_value) {}

                os::stringc name;
                os::stringc value;
            };
            class reference
            {
                public:
                    reference(u32 id = 0);
                    virtual ~reference();

                    virtual os::stringc getSerialiseName() { return "Reference"; }

                    /// added othe bloc in this bloc
                    virtual void operator += (reference*);
                    virtual void egals(reference*);

                    virtual void clear();
                    virtual void clearAttribute();
                    virtual void clearBloc();

                    virtual void addBloc(reference*);
                    virtual reference* getBloc(u32 index);
                    virtual reference* getBloc(os::stringc name);
                    virtual void removeBloc(os::stringc name);
                    virtual void removeBloc(u32 index);
                    virtual u32 getNumberBloc();

                    virtual void addAttribute(os::stringc name, os::stringc value = "");
                    virtual os::stringc getAttribute(os::stringc name);
                    virtual os::stringc getAttribute(u32 index);
                    virtual void removeAttribute(os::stringc name);
                    virtual void removeAttribute(u32 index);
                    virtual u32 getNumberAttribute();

                    virtual os::stringc serialise(const char *tablature = "");
                    virtual void unserialise(os::stringc);

                    virtual inline void setId(u32 i){ id = i; }
                    virtual inline u32 getId(){ return id; }
                protected:
                    math::array<reference*> bloc;
                    math::array<attribute> info;
                    os::stringc TypeName;
                    u32 id;
            };
        }
    }
}

#endif // REFERENCE
